<template>
  <div v-show="showLoading" class="loading-status">
    <div class="loading-content c-opacity90">
      <div class="line-scale-pulse-out">
        <div class="theme-bg"></div>
        <div class="theme-bg"></div>
        <div class="theme-bg"></div>
        <div class="theme-bg"></div>
        <div class="theme-bg"></div>
      </div>
      <div class="c-fs20 c-pt20 theme-fc" v-show="text.length > 0">{{text}}</div>
    </div>
  </div>
</template>
<script>
export default {
  props: {
    text: {
      type: String,
      default: '',
    },
    showLoading: {
      type: Boolean,
      default: false,
    },
  },
  data() {
    return {
      theme: localStorage.getItem("colorName") || 'mb5_default',
    };
  },
  mounted() {
    setTimeout(() => {
      this.theme = localStorage.getItem("colorName");
    }, 5000);
  },
};
</script>
<style scoped>
.loading-status {
  position: fixed;
  z-index: 999999;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  top: 0;
  left: 0;
}
.loading-content {
  background-color: rgba(255, 255, 255, 0.9);
  transform: scale(1);
  width: 4.5rem;
  height: 4.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  border-radius: 0.25rem;
  text-align: center;
  /* background-color: rgba(0, 0, 0, 0.5); */
}
.line-scale-pulse-out > div {
  width: 0.1rem;
  height: 0.9rem;
  border-radius: 2px;
  margin: 2px;
  -webkit-animation-fill-mode: both;
  animation-fill-mode: both;
  display: inline-block;
  -webkit-animation: line-scale-pulse-out 0.9s -0.6s infinite cubic-bezier(0.85, 0.25, 0.37, 0.85);
  animation: line-scale-pulse-out 0.9s -0.6s infinite cubic-bezier(0.85, 0.25, 0.37, 0.85);
}
.line-scale-pulse-out > div:nth-child(2),
.line-scale-pulse-out > div:nth-child(4) {
  -webkit-animation-delay: -0.4s !important;
  animation-delay: -0.4s !important;
}
.line-scale-pulse-out > div:nth-child(1),
.line-scale-pulse-out > div:nth-child(5) {
  -webkit-animation-delay: -0.2s !important;
  animation-delay: -0.2s !important;
}

@-webkit-keyframes line-scale-pulse-out {
  0% {
    -webkit-transform: scaley(1);
    transform: scaley(1);
  }
  50% {
    -webkit-transform: scaley(0.4);
    transform: scaley(0.4);
  }
  100% {
    -webkit-transform: scaley(1);
    transform: scaley(1);
  }
}
@keyframes line-scale-pulse-out {
  0% {
    -webkit-transform: scaley(1);
    transform: scaley(1);
  }
  50% {
    -webkit-transform: scaley(0.4);
    transform: scaley(0.4);
  }
  100% {
    -webkit-transform: scaley(1);
    transform: scaley(1);
  }
}
</style>


